import request from '@/utils/request.js'

// 分页查询
export const GetSysUserListByPage = (pageNum, pageSize, queryDto) => {
  return request({
    url: '/admin/system/user/findByPage/' + pageNum + '/' + pageSize,
    method: 'get',
    params: queryDto
  })
}

// 新增
export const saveSysUser = (sysUser) => {
  return request.post('/admin/system/user/save', sysUser)
}

export const updateSysUser = (sysUser) => {
  return request.post('/admin/system/user/update', sysUser)
}

export const deleteSysUserApi = (sysUserId) => {
  return request.delete('/admin/system/user/deleteById/' + sysUserId)
}

export const saveUserRoleApi = (sysUserRole) => {
  return request.post('/admin/system/user/saveSysUserRole', sysUserRole)
}

export const getUsersByRoleIdApi = (roleCode) => {
  return request.get('/admin/system/user/getUserForRoles/' + roleCode)
}
